package com.lc.utils;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

public class SortUtils {
    public static void sortMapListByDistance(List<Map<String, Object>> list) throws Exception{
        Collections.sort(list, new Comparator<Map<String, Object>>() {
            @Override
            public int compare(Map<String, Object> me1, Map<String, Object> me2) {
                int distance1 = (int) me1.get("distance");
                int distance2 = (int) me2.get("distance");
                return distance1-distance2;
            }
        });

    }
}
